package Controllers;

import java.sql.SQLException;
import java.util.HashMap;

import com.mysql.jdbc.ResultSet;

import Database.mysqlConnection;

/**
 *@author Juan Alapin - 324507516
 *@author Giora Yaffe - 036551281
 *@author Shachar Gritzman - 300174026
 *@author Nir Porat - 021515580
*/

public class ManPowerController {

	public ManPowerController(){}
	
	/**
	 * this Method change a committee member
	 * @param newID:int - new ID for the new member
	 * @param newRole:String - the new role of the member
	 * @param SqlDB:mysqlConnection - SQL DataBase
	 * @return the answer for applying the change
	 */
	public int changeComMember(int newID,String newRole,mysqlConnection SqlDB){
		return(SqlDB.SetComMember(newID,newRole));
	}
	
	
	
/**
 * This Method Returns All The The Id's Of The People With Different Id Than currentID
 * @param currentID:int
 * @param perLvl:int
 * @param SqlDB:mysqlConnection - SQL DataBase
 * @return HashMap<String,String>
 */
	public HashMap<String,String> getAllMenDifferentFromID(int currentID,int perLvl,mysqlConnection SqlDB){
		HashMap<String,String> details=null;
		try {
			details=SqlDB.getAllMenDifferentFromIdInDB(currentID,perLvl);
		} catch (SQLException e) {
			System.out.println("NoDifferentUsersFound");
		}
	return(details);
	}
	
	/**
	 * Retrieve Committee members
	 * @param SqlDB:mysqlConnection - SQL DataBase
	 * @return HashMap<String,String>
	 */
	public HashMap<String,String> getCommitteeMembers(mysqlConnection SqlDB){
		HashMap<String,String> committee=null;
		try {
			committee = SqlDB.getCommitteeMembers();
		} catch (SQLException e) {
			System.out.println("GotNoCommittee");
		}
		return(committee);
	}
	
	
}
